package cn.caishen.report.common.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class DatasourceConstant {

    public static String url;
    public static String driverClassName;
    public static String userName;
    public static String password;

    public static String DATASOURCE_DEFAULT_KEY = "DYNAMIC::REPORT";

    @Value("${spring.datasource.url}")
    public void setUrl(String url) {
        DatasourceConstant.url = url;
    }

    @Value("${spring.datasource.driver-class-name}")
    public void setDriverClassName(String driverClassName) {
        DatasourceConstant.driverClassName = driverClassName;
    }

    @Value("${spring.datasource.username}")
    public void setUserName(String userName) {
        DatasourceConstant.userName = userName;
    }

    @Value("${spring.datasource.password}")
    public void setPassword(String password) {
        DatasourceConstant.password = password;
    }
}
